﻿Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CheckBox1.Checked = My.Settings.DisplayUserName
        If My.Settings.DisplayUserName Then
            Label1.Text = My.User.Name
        Else
            Label1.Text = "No user name"
        End If
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        My.Settings.DisplayUserName = CheckBox1.Checked
    End Sub
End Class
